﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/Admin/Views/Shared/MainContent.Master"
    Inherits="System.Web.Mvc.ViewPage<MShop.Core.Domain.aspnet_Roles>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    角色管理
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<div id="fullBox">
  <div class="tabListBox">
  <% IEnumerable<MShop.Core.Domain.aspnet_Roles> roles = ViewData["roles"] as IEnumerable<MShop.Core.Domain.aspnet_Roles>; %>
    <table id="ETList" cellpadding="0" cellspacing="0">
	<thead>
        <tr>
            <th>
                角色名称
            </th>
            <th>操作</th>
        </tr>
		</thead>
		<tbody>
		<tr>
            <td>
           <% if (RouteData.Values["id"] != null)
       { %>
    <%=Html.Partial("Edit", Model)%>
    <%}
       else
       { %>
    <%=Html.Partial("create", Model)%>
    <%} %>
            </td>
            <td>
            
            </td>
        </tr>
        <% foreach (var item in roles)
           { %>
        <tr>
            <td>
                <%: item.RoleName %>
            </td>
            <td>
              <% if (item.CheckIsPower())
                 { %>
            <%: Html.ActionLink("后台权限", "Index", "Powers", new { roleid = item.RoleId }, null)%>    

            <%} %>
			<%: Html.ActionLink("编辑", "Index", new { id=item.RoleId }) %>                
              <% if (item.TotalUserCount == 0)
                 { %>
                |
                <%: Html.ActionLink("删除", "Delete", new { id = item.RoleId })%>  
                <%} %>  
            </td>
        </tr>
        <% } %>
		</tbody>
    </table>
    
  </div>
</div>
    
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="cphMeta" runat="server">
<script type="text/javascript">
        $(document).ready(function () {
            var windowWidth = $("#fullBox").width();
            var windowHeight = $("#fullBox").height() - 0;
            $('.tabListBox').css({ 'width': windowWidth + 'px', 'height': windowHeight + 'px' });
            $(window).resize(function () {
                var windowWidth = $("#fullBox").width();
                var windowHeight = $("#fullBox").height() - 0;
                $('.tabListBox').css({ 'width': windowWidth + 'px', 'height': windowHeight + 'px' });
            });
            $('.tabListBox').fixedHeaderTable({ footer: false, cloneHeaderToFooter: false, autoResize: true, fixCol1: true });

            $('.tabListBox').find("tbody").find("tr").each(function (i) {
                if (i % 2 == 1) {
                    $(this).find("td").addClass("tr1");
                }
            });
            $('.tabListBox').find("tbody").find("tr").mouseover(function (i) {
                $(this).find("td").addClass("tr0");
            });
            $('.tabListBox').find("tbody").find("tr").mouseout(function (i) {
                $(this).find("td").removeClass("tr0");
            });

        });
    </script>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="cphFooter" runat="server">
</asp:Content>
